<?php
/**
* @version		$Id: view.html.php 10496 2008-07-03 07:08:39Z ircmaxell $
* @package		Joomla
* @subpackage	Users
* @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

include_once(JPATH_BASE.DS.'includes'.DS.'CtbClass.php');

echo JPATH_BASE.DS.'includes'.DS.'CtbClass.php';
/**
 * HTML View class for the Users component
 *
 * @static
 * @package		Joomla
 * @subpackage	Users
 * @since 1.0
 */
class BanwordsViewLibrary extends JView
{
	function display($tpl = null)
	{
		$cid		= JRequest::getVar( 'cid', array(0), '', 'array' );
		
		$db 		=& JFactory::getDBO('shaishaidb');
        
		$query = "select * from banwords order by id asc";
		$db->setQuery( $query );
		$wordlist = $db->loadObjectList();
		//echo $wordlist[0]->banword;
		$outputstring="";
		//echo count($wordlist);
		foreach($wordlist as $value)
		{
			$outputstring.=$value->banword."|";
		}

		$outputstring=substr($outputstring,0,strlen($outputstring)-1);
		$ctb=new CtbClass();
		$ctb->file=JPATH_BASE.DS.'components'.DS.'com_banwords'.DS.'banwords.txt';
		//if($ctb->null_write($outputstring)) echo 'success';
		
		//echo	$outputstring;
		
		$this->assignRef('dictionary', $outputstring);


		parent::display($tpl);
	}
}
